package com.changli03.block.exer1;

public class User1 {
    private String Username;
    private String Password;
    private long registrationTime;
    //代码块
    {
        System.out.println("新用户注册");
        registrationTime = System.currentTimeMillis();
    }
    public User1 (){

        Username = System.currentTimeMillis()+"";
        Password = "123456";
    }
    public User1(String username, String password){
//        System.out.println("新用户注册");
//        registrationTime = System.currentTimeMillis();
        this.Username = username;
        this.Password = password;
    }

    public String getUsername() {
        return Username;
    }

    public void setUsername(String username) {
        Username = username;
    }

    public String getPassword() {
        return Password;
    }

    public void setPassword(String password) {
        Password = password;
    }

    public long getRegistrationTime() {
        return registrationTime;
    }
    public String getInfo (){
        return "用户名:"+this.getUsername()+",密码:"+this.getPassword()+",注册时间:"+this.getRegistrationTime();
    }
}
